json.result       true
json.message      "获取成功."
json.data         do
  json.id                       @user.id
  json.phone                    @user.phone
  json.nickname                 @user.nickname.blank? ? "未设置" : @user.nickname
  json.sex                      @user.sex
  json.avatar                   @user.avatar.url
  json.favorite_spus_count      @user.favorite_spus.count
  json.favorite_shops_count     @user.favorite_shops.count
  json.favorite_brands_count    @user.favorite_brands.count
  json.spu_tracks_count         @user.spu_tracks.count
  json.moneybag                 @user.moneybag
  json.bonus                    @user.bonus
  if ActiveModel::Type::Boolean.new.cast(Setting.fetch("use_membership"))
    json.membership               do
      json.id                     @user.membership.blank? ? 0 : @user.membership.id
      json.name                   @user.membership.blank? ? "马上开通会员" : @user.membership.name
      json.avatar                 @user.membership.blank? ? "" : @user.membership.avatar.url
      json.big_avatar             @user.membership.blank? ? "" : @user.membership.big_avatar.url
      json.discount               @user.membership.blank? ? 0 : @user.membership.discount
      json.price                  @user.membership.blank? ? 0 : @user.membership.price
    end
  end
  json.share_title              "#{Setting.fetch("app_name")}"
  json.share_content            "#{@user.nickname.blank? ? "未设置" : @user.nickname}邀请你使用#{Setting.fetch("app_name")}"
  json.share_avatar             "http://www.hnxfsy.cn/logo.png"
  json.share_url                "#{Setting.fetch("android_download_url")}"
end